package com.zhj.test.netty.buf;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;

/**
 * @author zhj
 */
public class NettyByteBuf01 {
    public static void main(String[] args) {
        ByteBuf buf = Unpooled.buffer(10);
        for (int i = 0; i < buf.capacity(); i++) {
            buf.writeByte(i);
        }
        System.out.println("capacity = " + buf.capacity());
        for (int i = 0; i < buf.capacity(); i++) {
            // System.out.println(buf.getByte(i));
            System.out.println(buf.readByte());
        }
        System.out.println("执行完毕！");
    }
}
